﻿using System;
using System.Linq;

class MaxSumSequence
{
    static void Main()
    {
        int[] numbers = { 2, 3, -6, -1, 2, -1, 6, 4, -8, 8 };

        int bestSum = int.MinValue;
        int startElement = 0;
        int endElement = 0;

        for (int counter = 0; counter < numbers.Length; counter++)
        {
            int sum = 0;
            int tempStartElement = counter;
            int tempEndElement = counter;

            for (int sequenceCounter = counter; sequenceCounter < numbers.Length; sequenceCounter++)
            {
                sum += numbers[sequenceCounter];
                tempEndElement++;

                if (sum > bestSum)
                {
                    bestSum = sum;
                   
                    startElement = tempStartElement;
                    endElement = tempEndElement;

                }
            }
        }

        for (int counter = startElement; counter < endElement; counter++)
        {
            Console.Write("{0}, ",numbers[counter]);

        }
        Console.WriteLine();

    }
}